/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import com.google.code.morphia.dao.BasicDAO;
import entity.SubCategory;
import org.bson.types.ObjectId;

/**
 *
 * @author xuanhung2401
 */
public class SubCategoryModel extends BasicDAO<SubCategory, ObjectId>{
    public SubCategoryModel() {
        super(DBConnection.getMongo(), DBConnection.getMorphia(), DBConnection.getDatabase());
    }
    
    public SubCategory findByAlias(String alias) {
        return ds.find(SubCategory.class, "alias", alias).get();
    }
  
}